<?php
include("conf/config.php");
include("wz_status.php");
?>
<!doctype html>
<html>
<head>
    <title>Wohnzimmer</title>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.css">
<script type='text/javascript' >
$(window).load(function(){
$("#slider").on("slidestop", function (event,ui) {
var value = event.target.value;
	
$.ajax({
   url : "http://<?php echo $ccuurl;?>/config/xmlapi/statechange.cgi",
   type : "GET",
   data: {ise_id: "3913", new_value: value },
   dataType: "html"
  });	
});
});
</script>
<script type="text/javascript">
 function refreshPage() {
  $.mobile.changePage(
    window.location.href,
    {
      allowSamePageTransition : true,
      transition              : 'flip',
      showLoadMsg             : false,
      reloadPage              : true
    }
  );
}
</script>
    <script type='text/javascript' src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script type='text/javascript' src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.js"></script>
	</head>
<body>
    <div data-role="page" id="wz" data-dom-cache="true">
 
        <div data-role="header">
		 <a href="index.php" data-role="button" data-direction="reverse" data-iconpos="notext" data-transition="slide" data-icon="back">Zur&uuml;ck</a>		
            <h1>Wohnzimmer</h1>
		 <a href="#" data-role="button" data-transition="flip" data-icon="refresh" data-iconpos="notext" onclick="refreshPage(); return false">Aktualisieren</a>
        </div>
		<!-- /header -->
 
        <div data-role="content">
	        <p>Temperatur Wohnzi./K&uuml;che: <?php echo $temp;?> &deg;C</p>
			<p>Feuchte Wohnzi./K&uuml;che: <?php echo $feuchte;?> &#037;</p>
			<form>
			<label for="slider">Soll Temperatur Wohnzi/K&uuml;che: <?php echo $soll;?> &deg;C</label>
		    <input type="range" name="slider" id="slider" value="<?php echo $soll;?>" min="15" max="30" />
			</form>
			<img src="grafik_wz.php">
			<p><a href="grafik_wz_2tage.php" data-role="button" data-inline="true" data-mini="true" data-transition="slide">2 Tage</a><a href="grafik_wz_3tage.php" data-role="button" data-inline="true" data-mini="true" data-transition="slide" >3 Tage</a></p>
        </div>
		<!-- /content -->
 
      
 
    </div>
	<!-- /page -->
</body>
</html>